//
//  NKTabBar.m
//  NiKi
//
//  Created by qiang chen on 16/6/20.
//  Copyright © 2016年 qiang chen. All rights reserved.
//

#import "NKTabBar.h"
#import "UIButton+OxTitleAndImageType.h"
@interface NKTabBar () {
    
    __weak IBOutlet UIButton *_baoBaoBtn;
    __weak IBOutlet UIButton *_listenBtn;
    __weak IBOutlet UIButton *_homeBtn;
    __weak IBOutlet UIButton *_animatBtn;
    __weak IBOutlet UIButton *_parentsBtn;
    
    UIButton *_selectBtn;
}
@end

@implementation NKTabBar

-(void)awakeFromNib {
    [_baoBaoBtn layoutButtonWithEdgeInsetsStyle:OxButtonEdgeInsetsTop space:5.f];
    [_listenBtn layoutButtonWithEdgeInsetsStyle:OxButtonEdgeInsetsTop space:5.f];
    [_homeBtn layoutButtonWithEdgeInsetsStyle:OxButtonEdgeInsetsTop space:5.f];
    [_animatBtn layoutButtonWithEdgeInsetsStyle:OxButtonEdgeInsetsTop space:5.f];
    [_parentsBtn layoutButtonWithEdgeInsetsStyle:OxButtonEdgeInsetsTop space:5.f];
}

- (IBAction)btnClick:(UIButton *)sender {
    _selectBtn.selected = NO;
    sender.selected = YES;
    _selectBtn = sender;
    if ([self.delegate respondsToSelector:@selector(tabBar:didClickBtn:)]) {
        [self.delegate tabBar:self didClickBtn:(NSInteger)sender.tag];
    }
}

@end
